Repository navigation
fix(fleet): classify GraphQL hidden-node errors as permission refusals - #12409
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e44c416ff0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A "Could not resolve to a node" error is not a whole-operation pre-execution refusal: GraphQL executes mutation fields serially, so a batched mutation may already have run an earlier field (e.g. an addComment) before a later field's node fails to resolve. Classifying it as Permission let run_with_provider replay the whole mutation under the next token and duplicate the part that landed. New FailureClass::NodeResolution: classify_failure returns it for the hidden-node string, and may_retry repeats it only for read-only calls, like any other failure. Permission/RateLimit writes are unchanged. The module retry-safety comment is corrected to match, and the classify/retry-gate tests plus a fake-gh end-to-end test (batched mutation attempted exactly once; the same failure on a query fails over) cover it. Addresses the Codex review thread on #12409 (comment 4656742134).
Completes the remaining half of #12154.
PR #12157 already let GraphQL board reads fail over to the App identity (
is_graphql_read), but left failure classification unchanged.classify_failure()inpkgs/fleet/crates/fleet/src/gh.rsdid not recognise GitHub'sCould not resolve to a node with the global id of '...'error — the refusal GitHub returns when the acting identity cannot see the node at all — so those failures were not classified as permission refusals and did not trigger the identity failover path.This change:
could not resolve to a nodeto the permission-refusal patterns inclassify_failure(), with a comment explaining the hidden-node caseclassify_failure_recognizes_refusalsasserting the GraphQL hidden-node message classifies asFailureClass::PermissionNote: the change was prepared and verified by inspection against current main; it was not compiled locally (no Rust toolchain in the sandbox), so CI is the first compile/test run.
Closes #12154
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.